﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/AdminMasterPage.master" AutoEventWireup="true" CodeFile="quan-ly-home-slide.aspx.cs" Inherits="Admin_quan_ly_home_slide" Title="Untitled Page" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  <ajaxToolkit:ToolkitScriptManager runat="Server" EnableScriptGlobalization="true"
        EnableScriptLocalization="true" ID="ScriptManager1" ScriptMode="Debug" CombineScripts="false" />
    <asp:GridView ID="grvHomeSlide" runat="server" AutoGenerateColumns="False" 
        onrowcancelingedit="grvHomeSlide_RowCancelingEdit" 
        onrowdeleting="grvHomeSlide_RowDeleting" onrowediting="grvHomeSlide_RowEditing" 
        onrowupdating="grvHomeSlide_RowUpdating" DataKeyNames="SlideID" 
        ondatabound="grvHomeSlide_DataBound">
        <Columns>
            <asp:TemplateField HeaderText="Nhà Hàng">
                <ItemTemplate>
                    <asp:Label ID="lblResName" runat="server" Text='<%# Eval("TenNhaHang") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtResName" runat="server" Text='<%# Eval("TenNhaHang") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Tiêu Đề">
                <ItemTemplate>
                    <asp:Label ID="lblTitle" runat="server" Text='<%# Eval("TieuDe") %>'></asp:Label></ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtTitle" runat="server" Text='<%# Eval("TieuDe") %>'></asp:TextBox>
                    </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Mô Tả">
                <ItemTemplate>
                    <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("MoTa") %>'></asp:Label></ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtDescription" runat="server" Text='<%# Eval("MoTa") %>'></asp:TextBox></EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Ngày Bắt Đầu">
                <ItemTemplate>
                    <asp:Label ID="lblStartDate" runat="server" Text='<%# Eval("NgayBatDau") %>'></asp:Label></ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtDayStart" runat="server" autocomplete="off" Text='<%# Eval("NgayBatDau") %>'></asp:TextBox>
                        <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server"  TargetControlID="txtDayStart" />
                    </EditItemTemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="Ngày Kết Thúc">
                <ItemTemplate>
                    <asp:Label ID="lblEndDate" runat="server" Text='<%# Eval("NgayKetThuc") %>'></asp:Label></ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtDayEnd" runat="server" autocomplete="off" Text='<%# Eval("NgayKetThuc") %>'></asp:TextBox>
                        <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server"  TargetControlID="txtDayEnd" />
                    </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Hình Ảnh">
                <ItemTemplate><img alt="" src='<%# "../"+Eval("DuongDan") %>' width="30" /></ItemTemplate>
                <EditItemTemplate>
                    <asp:FileUpload ID="fuAvatar" runat="server" /></EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Active">
                <ItemTemplate>
                    <asp:CheckBox ID="cbActive" runat="server" Checked='<%# Eval("IsActive") %>' /></ItemTemplate>
                    <EditItemTemplate><asp:CheckBox ID="cbActive" runat="server" Checked='<%# Eval("IsActive") %>' /></EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Trang Chủ">
                <ItemTemplate>
                    <asp:CheckBox ID="cbOnHome" runat="server" Checked='<%# Eval("OnHome") %>' /></ItemTemplate>
                    <EditItemTemplate><asp:CheckBox ID="cbOnHome" runat="server" Checked='<%# Eval("OnHome") %>' /></EditItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ButtonType="Button" HeaderText="Sửa" ShowEditButton="True" />
            <asp:CommandField ButtonType="Button" HeaderText="Xóa" 
                ShowDeleteButton="True" />
            
        </Columns>
    </asp:GridView><br />
    <h1>Thêm Slide</h1>
    <span>Chọn Nhà Hàng</span><asp:DropDownList ID="ddlRes" runat="server">
    </asp:DropDownList><span>Nhập Tiêu Đề</span><asp:TextBox ID="txtResTitle" runat="server"></asp:TextBox><span>Nhập Mô Tả</span><asp:TextBox ID="txtResDescription" runat="server"></asp:TextBox><span>Banner</span><asp:FileUpload
        ID="fuResBanner" runat="server" /><br />
    <span>Ngày bắt đầu</span><asp:TextBox ID="txtStartDay" runat="server" autocomplete="off"></asp:TextBox><ajaxToolkit:CalendarExtender ID="defaultCalendarExtender" runat="server"  TargetControlID="txtStartDay" /><span>Ngày kết thúc</span><asp:TextBox
        ID="txtEndDay" runat="server" autocomplete="off"></asp:TextBox><ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server"  TargetControlID="txtEndDay" />
    <asp:RadioButtonList ID="rblActive" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
        <asp:ListItem Value="1">Active</asp:ListItem>
        <asp:ListItem Value="0">UnActive</asp:ListItem>
    </asp:RadioButtonList>
    <asp:RadioButtonList ID="rblOnHome" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
        <asp:ListItem Value="1">OnHome</asp:ListItem>
        <asp:ListItem Value="0">UnOnHome</asp:ListItem>
    </asp:RadioButtonList>
    <asp:Button ID="btnOK" runat="server" Text="Thêm Mới" onclick="btnOK_Click" /><br />
    <asp:Label ID="lblInfo" runat="server" ></asp:Label>
</asp:Content>

